﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SanguoSharp
{

    /// <summary>
    /// A struct used to pass the information needed for creating a player from a client to a server.
    /// </summary>
    [Serializable]
    public struct CreatePlayerData
    {
        /// <summary>
        /// The name of the player.
        /// </summary>
        public string Name
        {
            get;
            set;
        }
        /// <summary>
        /// The avatar of the player.
        /// </summary>
        /// <remarks>
        /// Should contain image data encoded in the PNG format.
        /// Other popular formats (JPG, TIFF, ...) can also be used,
        /// but only PNG is guaranteed to be supported by clients.
        /// </remarks>
        public byte[] Image
        {
            get;
            set;
        }
        /// <summary>
        /// The password of the player.
        /// </summary>
        public Password Password
        {
            get;
            set;
        }

        /// <summary>
        /// Creates a new instance with the specified data.
        /// </summary>
        /// <param name="name">
        /// The name of the player.
        /// </param>
        /// <param name="image">
        /// The avatar of the player.
        /// </param>
        /// <param name="password">
        /// The password of the player.
        /// </param>
        public CreatePlayerData(string name, byte[] image, string password)
            : this()
        {
            Name = name;
            Image = image;
            Password = new Password(password);
        }
    }
}
